package com.example.cloudpracticeplatform.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 
 * 统计数据实体类
 */
@Data
@AllArgsConstructor
public class Statistics {
    // 基础统计信息
    private Long totalTeachers;      // 教师总数
    private Long totalCourses;       // 课程总数
    private Long totalStudents;      // 学生总数
    private Long totalEnrollments;   // 选课总数
    private Long totalContainers;    // 容器总数

    // 教师相关统计
    private Long coursesCreatedByTeacher; // 某教师创建的课程数
    private Long enrollmentsForTeacher;   // 某教师课程的选课人数

    // 课程相关统计
    private String courseLevel;           // 课程难度等级
    private Long courseCountForLevel;     // 某个难度等级的课程数量
    private Double averageCourseDuration; // 平均课程时长
    private Integer minCourseDuration;    // 最短课程时长
    private Integer maxCourseDuration;    // 最长课程时长
    private Long enrollmentsForCourse;    // 某门课程的选课人数

    // 选课相关统计
    private Long enrollmentsByWeek;       // 某周的选课数量
    private Long enrollmentsByMonth;      // 某月的选课数量

    // 容器相关统计
    private String containerStatus;       // 容器状态
    private Long containersForStatus;     // 某种状态的容器数量
    private Double averageContainerDuration; // 平均容器使用时长
    private Integer minContainerDuration;    // 最短容器使用时长
    private Integer maxContainerDuration;    // 最长容器使用时长

    // 构造方法、getters和setters
    public Statistics() {}

    // Builder模式
    public static class Builder {
        private Statistics statistics = new Statistics();

        public Builder setTotalTeachers(Long totalTeachers) {
            statistics.totalTeachers = totalTeachers;
            return this;
        }

        public Builder setTotalCourses(Long totalCourses) {
            statistics.totalCourses = totalCourses;
            return this;
        }

        public Builder setTotalStudents(Long totalStudents) {
            statistics.totalStudents = totalStudents;
            return this;
        }

        public Builder setTotalEnrollments(Long totalEnrollments) {
            statistics.totalEnrollments = totalEnrollments;
            return this;
        }

        public Builder setTotalContainers(Long totalContainers) {
            statistics.totalContainers = totalContainers;
            return this;
        }

        public Builder setCoursesCreatedByTeacher(Long coursesCreatedByTeacher) {
            statistics.coursesCreatedByTeacher = coursesCreatedByTeacher;
            return this;
        }

        public Builder setEnrollmentsForTeacher(Long enrollmentsForTeacher) {
            statistics.enrollmentsForTeacher = enrollmentsForTeacher;
            return this;
        }

        public Builder setCourseLevel(String courseLevel) {
            statistics.courseLevel = courseLevel;
            return this;
        }

        public Builder setCourseCountForLevel(Long courseCountForLevel) {
            statistics.courseCountForLevel = courseCountForLevel;
            return this;
        }

        public Builder setAverageCourseDuration(Double averageCourseDuration) {
            statistics.averageCourseDuration = averageCourseDuration;
            return this;
        }

        public Builder setMinCourseDuration(Integer minCourseDuration) {
            statistics.minCourseDuration = minCourseDuration;
            return this;
        }

        public Builder setMaxCourseDuration(Integer maxCourseDuration) {
            statistics.maxCourseDuration = maxCourseDuration;
            return this;
        }

        public Builder setEnrollmentsForCourse(Long enrollmentsForCourse) {
            statistics.enrollmentsForCourse = enrollmentsForCourse;
            return this;
        }

        public Builder setEnrollmentsByWeek(Long enrollmentsByWeek) {
            statistics.enrollmentsByWeek = enrollmentsByWeek;
            return this;
        }

        public Builder setEnrollmentsByMonth(Long enrollmentsByMonth) {
            statistics.enrollmentsByMonth = enrollmentsByMonth;
            return this;
        }

        public Builder setContainerStatus(String containerStatus) {
            statistics.containerStatus = containerStatus;
            return this;
        }

        public Builder setContainersForStatus(Long containersForStatus) {
            statistics.containersForStatus = containersForStatus;
            return this;
        }

        public Builder setAverageContainerDuration(Double averageContainerDuration) {
            statistics.averageContainerDuration = averageContainerDuration;
            return this;
        }

        public Builder setMinContainerDuration(Integer minContainerDuration) {
            statistics.minContainerDuration = minContainerDuration;
            return this;
        }

        public Builder setMaxContainerDuration(Integer maxContainerDuration) {
            statistics.maxContainerDuration = maxContainerDuration;
            return this;
        }

        public Statistics build() {
            return statistics;
        }
    }
}